<!DOCTYPE html>
<html>
<head>
<style>
#error {
  display: none;
}
</style>
<link rel="stylesheet" href="../domui/css/button.css">
<link rel="stylesheet" href="../domui/css/chrome_shared.css">
<link rel="stylesheet" href="../domui/css/list.css">
<link rel="stylesheet" href="../domui/css/select.css">

<link rel="stylesheet" href="../options/css/list.css">

<link rel="stylesheet" href="../css/plugin_list.css">
<link rel="stylesheet" href="../css/rule_list.css">

<script src="http://closure-library.googlecode.com/svn/trunk/closure/goog/base.js"></script>
<script src="../domui/js/cr.js"></script>
<script src="../domui/js/cr/event_target.js"></script>
<script src="../domui/js/cr/ui.js"></script>
<script src="../domui/js/cr/ui/array_data_model.js"></script>
<script src="../domui/js/cr/ui/list_item.js"></script>
<script src="../domui/js/cr/ui/list_selection_controller.js"></script>
<script src="../domui/js/cr/ui/list_selection_model.js"></script>
<script src="../domui/js/cr/ui/list_single_selection_model.js"></script>
<script src="../domui/js/cr/ui/list.js"></script>
<script src="../domui/js/util.js"></script>

<script src="../options/js/deletable_item_list.js"></script>
<script src="../options/js/inline_editable_list.js"></script>

<script src="plugin_list.js" type="text/javascript"></script>
<script src="plugin_settings.js" type="text/javascript"></script>
<script src="rule_list.js" type="text/javascript"></script>

<script>
goog.require('goog.testing.jsunit');
</script>
<script src="chrome_stubs.js" type="text/javascript"></script>
</head>
<body>
<div id="error"></div>
<script>
function testConstruction() {
  var pluginList = document.createElement('list');
  document.body.appendChild(pluginList);
  pluginSettings.ui.PluginList.decorate(pluginList);
  var plugins = [
    {
      'id': 'myplugin',
      'description': 'My Plugin'
    }
  ];
  var rules = {
    'http://example.com/*': 'block',
    'http://moose.org/*': 'allow',
  };
  createSettings(rules);
  pluginList.dataModel = new cr.ui.ArrayDataModel(plugins);
  assertEquals('My Plugin',
               pluginList.querySelector('.plugin-name').textContent);
  assertEquals('(2 rules)', pluginList.querySelector('.num-rules').textContent);
}
</script>
</body>
</html>
